#include <iostream>
using namespace std;
class A
{
public:
A(int k)
{
i = k;
}
int i ;
};
class B : public A
{
public:
B(const A & k): A (k)
{
}

};
A function ()
{
	A obj(3);
	obj.i = 3;
	return obj;
}
int main()
{
	B obj (function ());
	cout<<obj.i<<endl;
	return 0;
}
